<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html >
<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <!-- Favicons -->
    <link rel="apple-touch-icon" href="${pageContext.request.contextPath}/assets/img/kit/pro/apple-icon.png">
    <link rel="icon" href="${pageContext.request.contextPath}/assets/img/kit/pro/favicon.png">
    <title>
        小儿推拿
    </title>
    <!--     Fonts and icons     -->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/font-awesome.min1.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.min.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/material-kit.css?v=2.0.2">
    <!-- Documentation extras -->
    <!-- CSS Just for demo purpose, don't include it in your project -->
    <link href="${pageContext.request.contextPath}/assets/assets-for-demo/demo.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/assets/assets-for-demo/vertical-nav.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/css/home.css" rel="stylesheet" />
    <style>
        .card .card-header-info {
            -webkit-box-shadow: 0 5px 20px 0px rgba(0, 0, 0, 0.2), 0 13px 24px -11px rgba(39, 151, 176, 0.6);
            box-shadow: 0 5px 20px 0px rgba(0, 0, 0, 0.2), 0 13px 24px -11px rgba(39, 151, 176, 0.6);
        }
        .card .card-header-info, .card.bg-info, .card.card-rotate.bg-info .front, .card.card-rotate.bg-info .back {
            background: linear-gradient(60deg, #4750bc, #1f8aa2);
        }
    </style>
</head>

<body class="login-page ">
<nav class="navbar navbar-color-on-scroll navbar-transparent    fixed-top  navbar-expand-lg " color-on-scroll="100" id="sectionsNav">
    <div class="container">
        <div class="navbar-translate">
            <h2 class="title" style="color:white;font-family:KaiTi_GB2312;"><img src="${pageContext.request.contextPath}/assets/img/kit/pro/gytlogo.png" width="180px"> </h2>

            <!-- <button class="navbar-toggler" type="button" data-toggle="collapse" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
                <span class="navbar-toggler-icon"></span>
                <span class="navbar-toggler-icon"></span>
            </button> -->
        </div>
        <div class="collapse navbar-collapse">
            <ul class="navbar-nav ml-auto">

            </ul>
        </div>
    </div>
</nav>
<div class="page-header header-filter loginbg">
    <div class="container">
        <div class="row">
            <div class="col-md-4 col-sm-6 ml-auto mr-auto">
                <div class="card card-signup">
                    <form class="form" method="" action="">
                        <div class="card-header card-header-info text-center">
                            <h4 class="card-title">登录</h4>
                            <div class="social-line">
                                <a href="#pablo" class="">
                                    <h4  style="color:white;">管理系统 </h4>
                                </a>

                            </div>
                        </div>
                        <p class="description text-center">  &nbsp;</p>
                        <div class="card-body">
                            <div class="input-group">
                                <div class="input-group-prepend">
                                        <span class="input-group-text">
                                            <i class="material-icons">face</i>
                                        </span>
                                </div>
                                <input type="text" class="form-control" name="userNo" placeholder="用户名...">
                            </div>

                            <div class="input-group">
                                <div class="input-group-prepend">
                                        <span class="input-group-text">
                                            <i class="material-icons">lock_outline</i>
                                        </span>
                                </div>
                                <input type="password" class="form-control" name="userPwd" placeholder="密码...">
                            </div>
                            <div class="input-group">

                            </div>
                            <!-- If you want to add a checkbox to this form, uncomment this code

                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" name="optionsCheckboxes" checked>
                                    Subscribe to newsletter
                                </label>
                            </div> -->
                        </div>
                        <div class="footer text-center">
                            <a href="javascript:checkUser()" class="btn btn-info btn-link btn-wd btn-lg">登录</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="row">
        </div>
    </div>
    <footer class="footer navbar-fixed-bottom">
        <div class="container">
            <div class="row" ><h1></h1></div>
            <div class="row" ><h1></h1></div>
            <div class="row" ><h1></h1></div>
            <div class="copyright float-left">
                &#xA9;
                <script>
                    document.write(new Date().getFullYear())
                </script>,国医堂小儿推拿连锁机构
            </div>
            <div class="float-right copyright">
                <%--技术支持由&nbsp;<a href="http://www.dmpp.net.cn" target="_blank">北京代码澎湃科技有限公司</a>&nbsp;提供--%>
            </div>
        </div>
    </footer>
</div>
<!--   Core JS Files   -->
<script src="${pageContext.request.contextPath}/assets/js/core/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/js/resource/jquery.md5.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/core/popper.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/bootstrap-material-design.js"></script>
<!--  Google Maps Plugin  -->
<!-- <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE"></script> -->
<!--  Plugin for Date Time Picker and Full Calendar Plugin  -->
<script src="${pageContext.request.contextPath}/assets/js/plugins/moment.min.js"></script>
<!--	Plugin for the Datepicker, full documentation here: https://github.com/Eonasdan/bootstrap-datetimepicker -->
<script src="${pageContext.request.contextPath}/assets/js/plugins/bootstrap-datetimepicker.min.js"></script>
<!--	Plugin for the Sliders, full documentation here: http://refreshless.com/nouislider/ -->
<script src="${pageContext.request.contextPath}/assets/js/plugins/nouislider.min.js"></script>
<!--	Plugin for Select, full documentation here: http://silviomoreto.github.io/bootstrap-select -->
<script src="${pageContext.request.contextPath}/assets/js/plugins/bootstrap-selectpicker.js"></script>
<!--	Plugin for Tags, full documentation here: http://xoxco.com/projects/code/tagsinput/  -->
<script src="${pageContext.request.contextPath}/assets/js/plugins/bootstrap-tagsinput.js"></script>
<!--	Plugin for Fileupload, full documentation here: http://www.jasny.net/bootstrap/javascript/#fileinput -->
<script src="${pageContext.request.contextPath}/assets/js/plugins/jasny-bootstrap.min.js"></script>
<!--	Plugin for Small Gallery in Product Page -->
<script src="${pageContext.request.contextPath}/assets/js/plugins/jquery.flexisel.js"></script>
<!-- Plugins for presentation and navigation  -->
<script src="${pageContext.request.contextPath}/assets/assets-for-demo/js/modernizr.js"></script>
<script src="${pageContext.request.contextPath}/assets/assets-for-demo/js/vertical-nav.js"></script>
<!-- Material Kit Core initialisations of plugins and Bootstrap Material Design Library -->
<script src="${pageContext.request.contextPath}/assets/js/material-kit.js?v=2.0.2"></script>
<!-- Fixed Sidebar Nav - js With initialisations For Demo Purpose, Don't Include it in your project -->
<script src="${pageContext.request.contextPath}/assets/assets-for-demo/js/material-kit-demo.js"></script>

<script type="text/javascript">

    //验证登录
    function checkUser(){
        var _upData={
            userNo:$('input[name=userNo]').val(),
            userPwd: $.md5($('input[name=userPwd]').val())
        }
        $.ajax({
            type: "POST",
            url:"<%=request.getContextPath() %>/sign",
            data:_upData,
            async: false,
            success: function(data) {
                if(data.code == "0"){
                    window.location.href='<%=request.getContextPath() %>/index';
                }else if(data.code == "10021"){
                    alert(data.msg);
                    window.location.href='<%=request.getContextPath() %>/index';
                }else{
                    // layer.alert(data.msg,{icon:2});
                    alert(data.msg);
                }
            },
            error: function(request) {
                layer.alert("验证用户异常",{icon:2});
            }
        });
        
        
    }
    $(function(){
        // 提交
        $("input[name=userNo]").keydown(function(event) {
            if (event.keyCode == "13") {
                checkUser()
            }
        });
        $("input[name=userPwd]").keydown(function(event) {
            if (event.keyCode == "13") {
                checkUser()
            }
        });
        $(document).on('keydown',function(event) {
            if (event.keyCode == "13") {
                checkUser()
            }
        });
    })
        
</script>

</body>

</html>
